{{! -------------------------------------------------------------------------- }}
{{! Copyright 2002-2016, OpenNebula Project, OpenNebula Systems                }}
{{!                                                                            }}
{{! Licensed under the Apache License, Version 2.0 (the "License"); you may    }}
{{! not use this file except in compliance with the License. You may obtain    }}
{{! a copy of the License at                                                   }}
{{!                                                                            }}
{{! http://www.apache.org/licenses/LICENSE-2.0                                 }}
{{!                                                                            }}
{{! Unless required by applicable law or agreed to in writing, software        }}
{{! distributed under the License is distributed on an "AS IS" BASIS,          }}
{{! WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.   }}
{{! See the License for the specific language governing permissions and        }}
{{! limitations under the License.                                             }}
{{! -------------------------------------------------------------------------- }}

  {{{vnetsTableSelectHTML}}}
  <br>
  {{#advancedSection (tr "Advanced options") }}
  <fieldset>
    <legend>{{tr "Choose Network"}}</legend>
    <div class="row">
      <div class="medium-6 columns">
        <label for="NETWORK_ID">
          {{tr "Virtual Network ID"}}
        </label>
        <input type="text" wizard_field="NETWORK_ID" id="NETWORK_ID" name="NETWORK_ID"/>
      </div>
      <div class="medium-6 columns">
        <label for="NETWORK">
          {{tr "Virtual Network name"}}
        </label>
        <input type="text" wizard_field="NETWORK" id="NETWORK" name="NETWORK" />
      </div>
    </div>
    <div class="row">
      <div class="medium-6 columns">
        <label for="NETWORK_UID">
          {{tr "Virtual Network owner's user ID"}}
        </label>
        <input type="text" wizard_field="NETWORK_UID" id="NETWORK_UID" name="NETWORK_UID"/>
      </div>
      <div class="medium-6 columns">
        <label for="NETWORK_UNAME">
          {{tr "Virtual Network owner's user Name"}}
        </label>
        <input type="text" wizard_field="NETWORK_UNAME" id="NETWORK_UNAME" name="NETWORK_UNAME"/>
      </div>
    </div>
  </fieldset>
  <fieldset>
    <legend>{{tr "Override Network Values IPv4"}}</legend>
    <div class="row">
      <div class="medium-6 columns">
        <label for="IP">
          {{tr "IP"}}
        </label>
        <input type="text" wizard_field="IP" id="IP" name="IP" size="3" />
      </div>
      <div class="medium-6 columns">
        <label for="MAC">
          {{tr "MAC"}}
        </label>
        <input type="text" wizard_field="MAC" id="MAC" name="MAC"/>
      </div>
    </div>
    <div class="row">
      <div class="medium-6 columns">
        <label for="NETWORK_MASK">
          {{tr "Network mask"}}
        </label>
        <input type="text" wizard_field="NETWORK_MASK" id="NETWORK_MASK" name="NETWORK_MASK" placeholder="255.255.255.0"/>
      </div>
      <div class="medium-6 columns">
        <label for="NETWORK_ADDRESS">
          {{tr "Network address"}}
        </label>
        <input type="text" wizard_field="NETWORK_ADDRESS" id="NETWORK_ADDRESS" name="NETWORK_ADDRESS" placeholder="192.168.1.0"/>
      </div>
    </div>
    <div class="row">
      <div class="medium-6 columns">
        <label for="GATEWAY">
          {{tr "Gateway"}}
        </label>
        <input type="text" wizard_field="GATEWAY" id="GATEWAY" name="GATEWAY"/>
      </div>
      <div class="medium-6 columns">
        <label for="DNS">
          {{tr "DNS"}}
        </label>
        <input type="text" wizard_field="DNS" id="DNS" name="DNS"/>
      </div>
    </div>
    <div class="row">
      <div class="medium-6 columns">
        <label for="SEARCH_DOMAIN">
          {{tr "Search domain for DNS resolution"}}
        </label>
        <input type="text" wizard_field="SEARCH_DOMAIN" id="SEARCH_DOMAIN" name="SEARCH_DOMAIN"/>
      </div>
    </div>
  </fieldset>
  <fieldset>
    <legend>{{tr "Override Network Values IPv6"}}</legend>
    <div class="row">
      <div class="medium-6 columns">
        <label for="IP6_GLOBAL">
          {{tr "Global address"}}
        </label>
        <input type="text" wizard_field="IP6_GLOBAL" id="IP6_GLOBAL" name="IP6_GLOBAL" size="3" />
      </div>
      <div class="medium-6 columns">
        <label for="GATEWAY6">
          {{tr "Gateway"}}
        </label>
        <input type="text" wizard_field="GATEWAY6" id="GATEWAY6" name="GATEWAY6"/>
      </div>
    </div>
    <div class="row">
      <div class="medium-6 columns">
        <label for="CONTEXT_FORCE_IPV4">
          {{tr "Force IPv4 context"}}
          {{{tip (tr "Override force IPv4 for this IPv6 network. Values: Yes or No.")}}}
        </label>
        <input type="text" wizard_field="CONTEXT_FORCE_IPV4" id="CONTEXT_FORCE_IPV4" name="CONTEXT_FORCE_IPV4"/>
      </div>
    </div>
  </fieldset>
  <fieldset>
    <legend>{{tr "Override Network Inbound Traffic QoS"}}</legend>
    <div class="row">
      <div class="medium-4 columns">
        <label>
          {{tr "Average bandwidth (KBytes/s)"}}
          <input type="number" wizard_field="INBOUND_AVG_BW"/>
        </label>
      </div>
      <div class="medium-4 columns">
        <label>
          {{tr "Peak bandwidth (KBytes/s)"}}
          <input type="number" wizard_field="INBOUND_PEAK_BW"/>
        </label>
      </div>
      <div class="medium-4 columns">
        <label>
          {{tr "Peak burst (KBytes)"}}
          <input type="number" wizard_field="INBOUND_PEAK_KB"/>
        </label>
      </div>
    </div>
  </fieldset>
  <fieldset>
    <legend>{{tr "Override Network Outbound Traffic QoS"}}</legend>
    <div class="row">
      <div class="medium-4 columns">
        <label>
          {{tr "Average bandwidth (KBytes/s)"}}
          <input type="number" wizard_field="OUTBOUND_AVG_BW"/>
        </label>
      </div>
      <div class="medium-4 columns">
        <label>
          {{tr "Peak bandwidth (KBytes/s)"}}
          <input type="number" wizard_field="OUTBOUND_PEAK_BW"/>
        </label>
      </div>
      <div class="medium-4 columns">
        <label>
          {{tr "Peak burst (KBytes)"}}
          <input type="number" wizard_field="OUTBOUND_PEAK_KB"/>
        </label>
      </div>
    </div>
  </fieldset>
  <fieldset>
    <legend>{{tr "Hardware"}}</legend>
    <div class="row">
      <div class="small-12 columns">
        <label>
          <input type="checkbox" class="pci-type-nic"/>
          {{tr "PCI passthrough"}}
        </label>
      </div>
    </div>
    <div class="row nic-model-row">
      <div class="medium-6 columns">
        <label for="MODEL">
          {{tr "Hardware model to emulate"}}
        </label>
        <input type="text" wizard_field="MODEL" id="MODEL" name="MODEL" />
      </div>
    </div>
    <div class="row pci-row">
      <div class="small-12 columns">
        <table>
          <thead>
            <tr>
              <th style="width:50%">{{tr "Device name"}}</th>
              <th>{{tr "Vendor"}}</th>
              <th>{{tr "Device"}}</th>
              <th>{{tr "Class"}}</th>
              <th></th>
            </tr>
          </thead>
          <tbody>
          </tbody>
        </table>
      </div>
    </div>
  </fieldset>
  <fieldset>
    <legend>{{tr "Security Groups"}}</legend>
    <div name="str_nic_tab_id" str_nic_tab_id="{{nicTabId}}">
      {{{secgroupsTableSelectHTML}}}
    </div>
  </fieldset>
  {{! Hidden inputs for white/black ports and icmp drop. These inputs are
          deprecated, but keeping them hidden allows to preserve the values for
          previous templates in the update wizard. }}
  <div style="display: none;">
    <fieldset>
      <legend>TCP Firewall</legend>
      <div class="row">
        <div class="large-12 columns text-center">
          <input type="radio" class="tcp_type" name="tcp_type" id="{{nicTabId}}white_tcp_type" value="WHITE_PORTS_TCP">
          <label for="{{nicTabId}}white_tcp_type">Whitelist</label>
          <input type="radio" class="tcp_type" name="tcp_type" id="{{nicTabId}}black_tcp_type" value="BLACK_PORTS_TCP">
          <label for="{{nicTabId}}black_tcp_type">Blacklist</label>
        </div>
      </div>
      <div class="row">
        <div class="large-12 columns">
          <label for="TCP_PORTS">
            PORTS
          </label>
          <input type="text" id="TCP_PORTS" name="ports" />
        </div>
      </div>
    </fieldset>
    <fieldset>
      <legend>UDP Firewall</legend>
      <div class="row">
        <div class="large-12 columns text-center">
          <input type="radio" class="udp_type" name="udp_type" id="{{nicTabId}}white_udp_type" value="WHITE_PORTS_UDP">
          <label for="{{nicTabId}}white_udp_type">Whitelist</label>
          <input type="radio" class="udp_type" name="udp_type" id="{{nicTabId}}black_udp_type" value="BLACK_PORTS_UDP">
          <label for="{{nicTabId}}black_udp_type">Blacklist</label>
        </div>
      </div>
      <div class="row">
        <div class="large-12 columns">
          <label for="UDP_PORTS">
            PORTS
          </label>
          <input type="text" id="UDP_PORTS" name="ports" />
        </div>
      </div>
    </fieldset>
    <fieldset>
      <legend>ICMP</legend>
      <div class="row">
        <div class="large-12 columns">
          <label>
            <input type="checkbox" name="icmp_type" value="ICMP" id="icmp_type">Drop</label>
        </div>
      </div>
    </fieldset>
  </div>
  {{/advancedSection}}
